package com.itcast.demo;

public class MyThread extends Thread {
public MyThread(String name) {
        super(name);
    }
    @Override
    public void run() {

        for (int i = 0; i < 500; i++) {
            System.out.println("i=" + i);
            System.out.println("MyThread类-this.interrupted()= " + this.interrupted()
                    + ",Thread.currentThread().isInterrupted()= "
                    + Thread.currentThread().getName() + Thread.currentThread().isInterrupted());
            if (isInterrupted()) {
                break;
            }
        }
    }
}